package implementor;

import daoInterface.TransationPaymentDao;
import dbhandeling.Crude;
import dto.TransationPayment;

public class TransationPaymentDaoImplementor extends Crude implements TransationPaymentDao
{
String className=new TransationPayment().getClass().getName();
@Override
public void add(TransationPayment transationpayment) throws Exception
{
insert(transationpayment);
}
/***********************************************************/
@Override
public void update(TransationPayment transationpayment) throws Exception
{
super.update(className, "transactionId", transationpayment.gettransactionId()+"","autotransPaymentId",transationpayment.getAutotransPaymentId()+"");

}
/***********************************************************/
@Override
public void delete(TransationPayment transationpayment) throws Exception
{
super.delete(className,"autotransPaymentId",transationpayment.getAutotransPaymentId()+"");
}
/***********************************************************/
@Override
public TransationPayment retrieve(String conditionField,String conditionValue) throws Exception
{
TransationPayment transationpayment=(TransationPayment) super.retreive(className,conditionField,conditionValue);
return transationpayment;
}
/***********************************************************/
@Override
public TransationPayment[] retrieveArray(String conditionField,String conditionValue) throws Exception
{
TransationPayment[] transationpayment;
Object[] obj=super.retreiveArrayOnCondition(className,conditionField, conditionValue);
transationpayment=new TransationPayment[obj.length];
for(int i=0;i<transationpayment.length;i++)
{
transationpayment[i]=(TransationPayment) obj[i];
}
return transationpayment;
}
/***********************************************************/
@Override
public TransationPayment[] retrieveAll() throws Exception
{
TransationPayment[] transationpayment;
Object[] obj=super.retreiveAll(className);
transationpayment=new TransationPayment[obj.length];
for(int i=0;i<transationpayment.length;i++)
{
transationpayment[i]=(TransationPayment) obj[i];
}
return transationpayment;
}
/***********************************************************/
public int getAutoGenratedKey()
{
	 int key=super.getAutoGenratedKey(className,"autotransPaymentId") ;
	 return key;
}
}
